package com.dragons.spring5_reactor.reactor8;

/*public class Main {

    public static void main(String[] args) {
        Flow.Publisher<String> publisher = subscriber -> {
            subscriber.onNext("1"); // 1
            subscriber.onNext("2");
            subscriber.onError(new RuntimeException("����")); // 2
            //  subscriber.onComplete();
        };

        publisher.subscribe(new Flow.Subscriber<>() {
            @Override
            public void onSubscribe(Flow.Subscription subscription) { subscription.cancel(); }
            @Override
            public void onNext(Object item) {}
            @Override
            public void onNext(String item) { System.out.println(item); }
            @Override
            public void onError(Throwable throwable) { System.out.println("123"); }
            @Override
            public void onComplete() { System.out.println("publish complete"); }
        });
    }
}*/
